import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { User } from '@/types/user'
export const useUserStore = defineStore('cp_user', () => {
    // 用户信息
    const user = ref<User>()
    // 修改用户信息
    const setUser = (u: User) => {
        user.value = u
    }
    // 删除用户
    const delUser = () => {
        user.value = undefined
    }
    return { user, setUser, delUser }
}, {
    persist: true
})
